package com.bjesc_b2c.app.appraiset.mvp.view.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bjesc_b2c.app.appraiset.R;
import com.bjesc_b2c.app.appraiset.base.BaseFragmentActivity;
import com.bjesc_b2c.app.appraiset.mvp.view.fragment.CarChassisFragment;
import com.bjesc_b2c.app.appraiset.mvp.view.fragment.CarExteriorFragment;
import com.bjesc_b2c.app.appraiset.mvp.view.fragment.CarInteriorFragment;
import com.bjesc_b2c.app.appraiset.mvp.view.fragment.CarformalitiesFragment;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by yidong on 2017/8/7.
 */

public class CarImageActivity extends BaseFragmentActivity  {
    @Bind(R.id.tv_title)
    TextView titleTV;
    @Bind(R.id.iv_return)
    LinearLayout returnLin;
    private int checkedId;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_car_image);
        ButterKnife.bind(this);
        returnLin.setVisibility(View.VISIBLE);
        checkedId = getIntent().getIntExtra("checkedId",0);
        initViews();
    }

    private void initViews() {
        switch (checkedId) {
            case 0:
                titleTV.setText("车辆外观");
                switchContent(CarExteriorFragment.class, R.id.f2_content);
                break;
            case 1:
                titleTV.setText("内饰中控");
                switchContent(CarInteriorFragment.class, R.id.f2_content);
                break;
            case 2:
                titleTV.setText("发动机底盘");
                switchContent(CarChassisFragment.class, R.id.f2_content);
                break;
            case 3:
                titleTV.setText("手续照片");
                switchContent(CarformalitiesFragment.class, R.id.f2_content);
                break;

        }
    }

    @OnClick(R.id.iv_return)
    public void onClick() {
        finish();

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(this);
    }
}